﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:ctk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
	xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
	xmlns:ChemProV_UI="clr-namespace:ChemProV.UI"
    xmlns:ChemProV_UI_DrawingCanvas="clr-namespace:ChemProV.UI.DrawingCanvas"
    xmlns:ChemProV_EquationEditor ="clr-namespace:ChemProV.PFD.EquationEditor"
    xmlns:ProcessUnits="clr-namespace:ChemProV.PFD.ProcessUnits"
    xmlns:ChemProV_Validation_Feedback="clr-namespace:ChemProV.Validation.Feedback"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	x:Class="ChemProV.MainPage"
	mc:Ignorable="d"
	d:DesignHeight="600" d:DesignWidth="800" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
    MouseLeftButtonDown="MainPage_MouseLeftButtonDown" 
    MouseLeftButtonUp="MainPage_MouseLeftButtonUp" 
    MouseRightButtonDown="MainPage_MouseRightButtonDown" 
    MouseRightButtonUp="MainPage_MouseRightButtonUp" 
    KeyDown="MainPage_KeyDown" 
    >
    <ctk:DockPanel x:Name="LayoutRoot" Background="White" LastChildFill="True" 	>
        <!-- where the top menu items go for the application -->
        <StackPanel ctk:DockPanel.Dock="Top" Background="#EFEFEF">
                
            <!-- button shortcut toolbar.-->
            <StackPanel x:Name="ButtonToolbar" Orientation="Horizontal" Margin="3" >
                <Button Margin="0,0,5,0" Click="NewFileButton_Click">
                    <Image Source="/UI/Icons/toolbar_new.png" />
                </Button>
                <Button Margin="0,0,5,0" Click="OpenFileButton_Click">
                    <Image Source="/UI/Icons/toolbar_open.png" />
                </Button>
                <Button Margin="0,0,5,0" Click="SaveFileButton_Click">
                    <Image Source="/UI/Icons/toolbar_save.png" />
                </Button>
                <Button Margin="0,0,5,0" Click="UndoButton_Click">
                    <Image Source="/UI/Icons/toolbar_undo.png" />
                </Button>
                <Button Margin="0,0,5,0" Click="RedoClick_Click">
                    <Image Source="/UI/Icons/toolbar_redo.png" />
                </Button>
                <Button Name="Install_Button"  Margin="0,0,5,0" Click="InstallButton_Click">
                    <Image Source="/UI/Icons/toolbar_install.png" />
                </Button>
                <Button Margin="0,0,5,0" Click="HelpButton_Click">
                    <Image Source="/UI/Icons/toolbar_about.png" />
                </Button>
            </StackPanel>
        </StackPanel>
        <StackPanel>
            <ChemProV_UI:ProcessUnitPalette x:Name="PuPalette" ctk:DockPanel.Dock="Left" Background="White" Margin="5" />
            <Rectangle Width="Auto" Height="2" Fill="Gray" Margin="0,5,0,5" />
            <ScrollViewer VerticalScrollBarVisibility="Auto">
            <ChemProV_UI:CompoundTable x:Name="CompoundTable"/>
            </ScrollViewer>
        </StackPanel>
        <Grid x:Name="WorkspaceGrid">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition x:Name="BottomToolBoxRow" Height="150" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <!--drawing canvas -->
            <ScrollViewer
                x:Name="DrawingCanvasScollViewer"
                ScrollViewer.HorizontalScrollBarVisibility="Visible"
                ScrollViewer.VerticalScrollBarVisibility="Visible" 
                >
                <ChemProV_UI_DrawingCanvas:DrawingCanvas
            x:Name="DrawingCanvas" 
            Grid.Row="0" 
            Background="Gray"
            Width="2000"
            Height="2000" >
                </ChemProV_UI_DrawingCanvas:DrawingCanvas>
            </ScrollViewer>
                

            <!--resizer wiget -->
            <controls:GridSplitter 
			Grid.Row="1" 
			HorizontalAlignment="Stretch"
			VerticalAlignment="Center"
			Height="3"
			Background="LightGray" MouseMove="GridSplitter_MouseMove" />

            <!--feedback / equation window -->
            <Grid Grid.Row="2">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <ChemProV_Validation_Feedback:FeedbackWindow x:Name="FeedbackWindow"/>
                <ChemProV_EquationEditor:EquationEditor Grid.Column="1" x:Name="EquationEditor"/>
            </Grid>
        </Grid>
    </ctk:DockPanel>
</UserControl>